package exam;

public class Outer {
    public static void main(String[] args) {

                new Thread(() -> {
                    int num =10;
                    while(true){
                        synchronized (Outer.class ) {
                            if(num < 0){
                                break;
                            }
                            System.out.println( Thread.currentThread().getName()+ "获取到了一个数字为:" + num--);
                        }
                    }
                }).start();
            }
        }
}